package com.isesol.ime.manager;

import com.isesol.ime.dao.*;
import com.isesol.ime.entity.*;
import com.isesol.orm.jpa.*;
import org.springframework.stereotype.*;
import org.springframework.transaction.annotation.*;

import javax.annotation.*;
import java.util.*;

/**
 * 机床参数 Manager
 *
 * @author Peter Zhang
 * @author Wang Jun
 */
@Component
@Transactional
public class ParamManager extends AbstractJpaEntityManager<Param, Long>{

	/**
	 * 机床参数 DAO
	 */
	@Resource
	ParamDao paramDao;


	public List<Param> findByTypeId(long typeId){

		return paramDao.findByTypeId(typeId);
	}

	public List<Param> findByCategoryId(long categoryId){

		return paramDao.findByCategoryId(categoryId);
	}

	public List<Param> findByParamIdAndTypeId(String paramId,long typeId){

		return paramDao.findByParamIdAndTypeId(paramId,typeId);
	}

	public List<Param> findByTypeIdAndCaegoryId(long typeId,long categoryId){

		return paramDao.findByTypeIdAndCategoryId(typeId,categoryId);
	}

	@Override
	@Resource(type = ParamDao.class)
	protected void setDao(JpaDao dao){

		super.dao = dao;
	}


}
